#include<iostream>
using namespace std;
int main()
{ int a,b,c;
  for(a=0;a<34;a++)
   for(b=0;b<50;b++)
   {
       c=100-a-b;
       if(3*a+2*b+0.5*c==100)
        cout<<"大马"<<a<<"匹，中马"<<b<<"匹，小马"<<c<<"匹"<<endl;
   }
   return 0;
}
